package light.head.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;
/**
 * 车辆申请明细
 */
@Entity
@Table
public class VehicleApplyItem implements Serializable{

	
	private static final long serialVersionUID = -3023488556460611720L;
	
	
	private Integer code;
	private Integer vac;				// 用车申请编号
	private Integer vtc;				// 车辆编号
	private String vtn;					// 车辆类型名称
	private Integer count;				// 数量
	private Integer number;				// 指派数量
	private Boolean rInfo = false;		// 是否归还
	
	private List<Vehicle> vehicleList;	// 在派车的时候用到
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getVac() {
		return vac;
	}
	@Column
	public Integer getCount() {
		return count;
	}
	@Column
	public Integer getNumber() {
		return number;
	}
	@Column
	public Integer getVtc() {
		return vtc;
	}
	@Column
	public Boolean getrInfo() {
		return rInfo;
	}
	@Formula("(SELECT v.name FROM VehicleType v WHERE v.code = vtc)")
	public String getVtn() {
		return vtn;
	}
	
	@Transient
	public List<Vehicle> getVehicleList() {
		return vehicleList;
	}
	

	
	
	
	
	public void setrInfo(Boolean rInfo) {
		this.rInfo = rInfo;
	}
	public void setVehicleList(List<Vehicle> vehicleList) {
		this.vehicleList = vehicleList;
	}
	public void setVtc(Integer vtc) {
		this.vtc = vtc;
	}
	public void setVtn(String vtn) {
		this.vtn = vtn;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setVac(Integer vac) {
		this.vac = vac;
	}
	public void setCount(Integer count) {
		this.count = count;
	}
	public void setNumber(Integer number) {
		this.number = number;
	}
}
